package com.jinxin.platform.cdfaceacs.controller;

import com.jinxin.platform.base.common.pojo.JsonResult;
import com.jinxin.platform.cdfaceacs.bean.CdfaceacsAuthTempalte;
import com.jinxin.platform.cdfaceacs.bean.CdfaceacsDevice;
import com.jinxin.platform.cdfaceacs.rpc.SysUserRpc;
import com.jinxin.platform.cdfaceacs.service.IFaceAcsAuthTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2020-12-26
 * @Author: Lingnan
 **/
@RestController
@RequestMapping("/faceAcsAuthTemplate")
@Slf4j
public class FaceAcsAuthTemplateController {
    @Autowired
    private IFaceAcsAuthTemplateService acsAuthTemplateService;
    @Autowired
    private SysUserRpc sysUserRpc;

    @RequestMapping("/list")
    public Map<String,Object> list(@RequestParam int page, @RequestParam int limit, String name){
        HashMap param = new HashMap();
        param.put("page", page);
        param.put("limit", limit);
        param.put("name", name);
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("code",0);
        resultMap.put("msg","");
        resultMap.put("count", acsAuthTemplateService.listPageCount(param));
        resultMap.put("data", acsAuthTemplateService.listPage(param));
        return resultMap;
    }

    @PostMapping("/saveOrUpdate")
    public JsonResult saveOrUpdate(CdfaceacsAuthTempalte authTempalte){
        return acsAuthTemplateService.saveOrUpdate(authTempalte);
    }

    @GetMapping("/delete")
    public JsonResult delete(String id){
        return acsAuthTemplateService.delete(id);
    }

}
